package br.com.comanda.webservice.business;

import java.util.List;

import br.com.comanda.webservice.dao.BoardDAO;
import br.com.comanda.webservice.dao.impl.BoardDAOImpl;
import br.com.comanda.webservice.model.Board;
import br.com.comanda.webservice.persistence.HibernateUtil;

public class BoardBusiness {

	public List<Board> findAll() {
		BoardDAO boardDAO = new BoardDAOImpl();
		boardDAO.setSession(HibernateUtil.getSession());

		return boardDAO.findAll();
	}

	public Board findById(Long id) {
		BoardDAO boardDAO = new BoardDAOImpl();
		boardDAO.setSession(HibernateUtil.getSession());
		return boardDAO.findById(id);
	}

	public void save(Board board) {
		BoardDAO boardDAO = new BoardDAOImpl();
		boardDAO.setSession(HibernateUtil.getSession());
		boardDAO.save(board);
	}

}
